package operation;

import data.Data;
import data.DataBase;

public class SearchSampled implements IOperation{
    @Override
    public void work(DataBase dataBase) {
        System.out.println("查询采样记录！");
        System.out.println("已采样人员：");
        int currentSize=dataBase.getContainSize();
        for (int i = 0; i < currentSize; i++) {
            Data data = dataBase.getData(i);
            if (data.isSampled()) {
                System.out.println(data.getName() + data.getPhone() + "已采样");
            }
        }
        System.out.println("未采样人员：");
        for (int i = 0; i < currentSize; i++) {
            Data data = dataBase.getData(i);
            if (!data.isSampled()) {
                System.out.println(data.getName() + data.getPhone() + "未采样");
            }
        }

    }
}
